class Stack {
    constructor() {
        this.stack = []
    }
    push(ele) {
        this.stack.push(ele)
        return ele
    }
    pop() {
        return this.stack.pop()
    }
    len() {
        return this.stack.length
    }
    peek() {
        // 获取栈顶 => 数组的最后一项
        return this.stack[this.len() - 1]
    }
    clear() {
        this.stack.length = 0
    }
}